package com.cn.mmd.tools;

/**
 * Created by Administrator on 2016/8/12 0012.
 */
public class GetLimitNum {

    /**
     * 算出要分多少页
     * @param num 总数量
     * @param pageSize 每页数量
     * @return
     */
    public int getLimitNum(int num,int pageSize){
        if (num!=0&&pageSize!=0) {
            double num1 = num;
            double pageSize1 = pageSize;
            num1 = num1 / pageSize1;
            num = (int) Math.ceil(num1);
        }else {
            num = 0;
        }
            return num;
    }
}
